-
-
Notifications
You must be signed in to change notification settings - Fork 233
Fix WithProbability logic #1367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the probability logic in WireMock.Net's mapping matcher and adds probability testing functionality. The key issue was that the probability comparison was inverted, causing mappings with higher probability values to be selected less frequently than intended.
- Corrected the probability comparison logic from
<=
to>
to properly filter mappings based on their probability - Enhanced the mapping selection ordering to consider probability values in tie-breaking scenarios
- Added comprehensive probability testing in the example application to validate the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/WireMock.Net.Minimal/Owin/MappingMatcher.cs | Fixed probability filtering logic and improved mapping selection ordering |
examples/WireMock.Net.Console.NET8/Program.cs | Updated main method to support async operations for probability testing |
examples/WireMock.Net.Console.NET8/MainApp.cs | Added probability testing code to validate the fix with statistical verification |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1367 +/- ##
==========================================
- Coverage 35.71% 34.44% -1.28%
==========================================
Files 152 164 +12
Lines 34539 41307 +6768
==========================================
+ Hits 12337 14227 +1890
- Misses 21777 26641 +4864
- Partials 425 439 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
No description provided.